package main

import "fmt"

func main() {
	s1 := []int{10, 30, 50}
	fmt.Printf("s1: %p %p %v l=%-2d, c=%-2d\n", &s1, &s1[0], s1, len(s1), cap(s1))
	s2 := s1
	fmt.Printf("s2: %p %p %v l=%-2d, c=%-2d\n", &s2, &s2[0], s2, len(s2), cap(s2))

	// var a []int
	// fmt.Printf("%T %p %v len=%-2d, cap=%-2d\n", a, &a, a, len(a), cap(a))
	// //func append(slice []Type, elems ...Type) []Type
	// a = append(a, 10)
	// fmt.Printf("a: %T slice header: addr %p  len=%-2d, cap=%-2d , a[0] addr %p slice value: %v\n", a, &a, len(a), cap(a), &a[0], a)
	// fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	// s1 := []int{10}
	// fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1) // l 1 c 1
	// s1 = make([]int, 2, 5)
	// fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1) // l 2 c 5
	// fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	// s1 = append(s1, 100)
	// fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1) // [0 0 100] l 3 c 5
	// // s1 = append(s1, 1, 2)
	// // fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1) // [0 0 100 1 2] l 5 c 5
	// fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	// s2 := append(s1, 1, 2)
	// fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1) // [0 0 100] l 5 c 5

	// fmt.Printf("s2: %T slice header: addr %p  len=%-2d, cap=%-2d , s2[0] addr %p slice value: %v\n", s2, &s2, len(s2), cap(s2), &s2[0], s2) // [0 0 100 1 2] l 5 c 5
	// fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	// s3 := append(s1, -1)
	// fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1)
	// fmt.Printf("s2: %T slice header: addr %p  len=%-2d, cap=%-2d , s2[0] addr %p slice value: %v\n", s2, &s2, len(s2), cap(s2), &s2[0], s2)
	// fmt.Printf("s3: %T slice header: addr %p  len=%-2d, cap=%-2d , s3[0] addr %p slice value: %v\n", s3, &s3, len(s3), cap(s3), &s3[0], s3)
	// s4 := append(s3, 3, 4, 5)
	// fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1)
	// fmt.Printf("s2: %T slice header: addr %p  len=%-2d, cap=%-2d , s2[0] addr %p slice value: %v\n", s2, &s2, len(s2), cap(s2), &s2[0], s2)
	// fmt.Printf("s3: %T slice header: addr %p  len=%-2d, cap=%-2d , s3[0] addr %p slice value: %v\n", s3, &s3, len(s3), cap(s3), &s3[0], s3)
	// fmt.Printf("s4: %T slice header: addr %p  len=%-2d, cap=%-2d , s4[0] addr %p slice value: %v\n", s4, &s4, len(s4), cap(s4), &s4[0], s4) // l 7 c 10
	// s5 := append(s4, 6, 7, 8, 9)
	// fmt.Printf("s1: %T slice header: addr %p  len=%-2d, cap=%-2d , s1[0] addr %p slice value: %v\n", s1, &s1, len(s1), cap(s1), &s1[0], s1)
	// fmt.Printf("s2: %T slice header: addr %p  len=%-2d, cap=%-2d , s2[0] addr %p slice value: %v\n", s2, &s2, len(s2), cap(s2), &s2[0], s2)
	// fmt.Printf("s3: %T slice header: addr %p  len=%-2d, cap=%-2d , s3[0] addr %p slice value: %v\n", s3, &s3, len(s3), cap(s3), &s3[0], s3)
	// fmt.Printf("s4: %T slice header: addr %p  len=%-2d, cap=%-2d , s4[0] addr %p slice value: %v\n", s4, &s4, len(s4), cap(s4), &s4[0], s4)
	// fmt.Printf("s5: %T slice header: addr %p  len=%-2d, cap=%-2d , s5[0] addr %p slice value: %v\n", s5, &s5, len(s5), cap(s5), &s5[0] 0

}
